Optimal. Leaf size=52 \[ -\frac {a^2 \tanh ^{-1}(\cos (e+f x))}{f}+\frac {b (2 a-b) \sec (e+f x)}{f}+\frac {b^2 \sec ^3(e+f x)}{3 f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.05, antiderivative size = 52, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3664, 390, 207} \[ -\frac {a^2 \tanh ^{-1}(\cos (e+f x))}{f}+\frac {b (2 a-b) \sec (e+f x)}{f}+\frac {b^2 \sec ^3(e+f x)}{3 f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 207
Rule 390
Rule 3664
Rubi steps
\begin {align*} \int \csc (e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx &=\frac {\operatorname {Subst}\left (\int \frac {\left (a-b+b x^2\right )^2}{-1+x^2} \, dx,x,\sec (e+f x)\right )}{f}\\ &=\frac {\operatorname {Subst}\left (\int \left ((2 a-b) b+b^2 x^2+\frac {a^2}{-1+x^2}\right ) \, dx,x,\sec (e+f x)\right )}{f}\\ &=\frac {(2 a-b) b \sec (e+f x)}{f}+\frac {b^2 \sec ^3(e+f x)}{3 f}+\frac {a^2 \operatorname {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\sec (e+f x)\right )}{f}\\ &=-\frac {a^2 \tanh ^{-1}(\cos (e+f x))}{f}+\frac {(2 a-b) b \sec (e+f x)}{f}+\frac {b^2 \sec ^3(e+f x)}{3 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.17, size = 66, normalized size = 1.27 \[ \frac {3 a^2 \left (\log \left (\sin \left (\frac {1}{2} (e+f x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (e+f x)\right )\right )\right )+3 b (2 a-b) \sec (e+f x)+b^2 \sec ^3(e+f x)}{3 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.56, size = 87, normalized size = 1.67 \[ -\frac {3 \, a^{2} \cos \left (f x + e\right )^{3} \log \left (\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) - 3 \, a^{2} \cos \left (f x + e\right )^{3} \log \left (-\frac {1}{2} \, \cos \left (f x + e\right ) + \frac {1}{2}\right ) - 6 \, {\left (2 \, a b - b^{2}\right )} \cos \left (f x + e\right )^{2} - 2 \, b^{2}}{6 \, f \cos \left (f x + e\right )^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.55, size = 124, normalized size = 2.38 \[ \frac {a^{2} \ln \left (\csc \left (f x +e \right )-\cot \left (f x +e \right )\right )}{f}+\frac {2 a b}{f \cos \left (f x +e \right )}+\frac {b^{2} \left (\sin ^{4}\left (f x +e \right )\right )}{3 f \cos \left (f x +e \right )^{3}}-\frac {b^{2} \left (\sin ^{4}\left (f x +e \right )\right )}{3 f \cos \left (f x +e \right )}-\frac {b^{2} \left (\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )}{3 f}-\frac {2 \cos \left (f x +e \right ) b^{2}}{3 f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.31, size = 68, normalized size = 1.31 \[ -\frac {3 \, a^{2} \log \left (\cos \left (f x + e\right ) + 1\right ) - 3 \, a^{2} \log \left (\cos \left (f x + e\right ) - 1\right ) - \frac {2 \, {\left (3 \, {\left (2 \, a b - b^{2}\right )} \cos \left (f x + e\right )^{2} + b^{2}\right )}}{\cos \left (f x + e\right )^{3}}}{6 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 12.64, size = 86, normalized size = 1.65 \[ \frac {a^2\,\ln \left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )}{f}-\frac {4\,a\,b-{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\,\left (8\,a\,b-4\,b^2\right )-\frac {4\,b^2}{3}+4\,a\,b\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4}{f\,{\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2-1\right )}^3} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a + b \tan ^{2}{\left (e + f x \right )}\right )^{2} \csc {\left (e + f x \right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________